package com.study.utils.text;

import info.debatty.java.stringsimilarity.JaroWinkler;
import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;

/**
 * @author zhuzi
 * 2024/12/20 15:53
 */
@Slf4j
public class StringSimilaDemo {

    /**
     * 相似度对比 https://mp.weixin.qq.com/s/GHoZZzIoFqIHqdpY6qcZug
     */
    /***
     *
     */
    @Test
    public void jaroWinkler() {
        JaroWinkler jaroWinkler = new JaroWinkler();
        String name1 = "张小明";
        String name2 = "张晓明";
        double similarity = jaroWinkler.similarity(name1, name2);
        log.info("[{}-{}]相识度[{}]", name1, name2, similarity);
    }
}
